| Conditions | 2 |
| Total Lines | 12 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 29 | |||
| 30 | @Put(':id') |
||
| 31 | @Roles(UserRole.COOPERATOR, UserRole.EMPLOYEE) |
||
| 32 | @ApiOperation({summary: 'Update task'}) |
||
| 33 | public async index(@Param() dto: IdDTO, @Body() taskDto: TaskDTO) { |
||
| 34 | try { |
||
| 35 | const {id} = dto; |
||
| 36 | await this.commandBus.execute(new UpdateTaskCommand(id, taskDto.name)); |
||
| 37 | |||
| 38 | return {id}; |
||
| 39 | } catch (e) { |
||
| 40 | throw new BadRequestException(e.message); |
||
| 41 | } |
||
| 44 |